import { projects } from "../db";
import { ObjectId, Filter, Timestamp } from "mongodb";
import dayjs from "dayjs";

import * as db from "../db";
import { stats } from "../libs/stats";
import { ITodo } from "../models/todo";

/**
 * 查询任务列表
 * @returns
 */
export async function list(id: ObjectId) {
  const items = await db.projects.find({ _id: id }).toArray();
  const total = items.length;

  return {
    items,
    total,
  };
}

/**
 * 创建任务
 * @param record
 * @returns
 */
export async function create(record: ITodo) {
 
}

/**
 * 删除任务
 * @param _id 项目id
 * @param uid: 当前用户id
 */
export async function remove(_id: string, uid: string) {
  
}

/**
 * 搜索任务
 * @param keywords 搜索关键词
 */
export async function search(keywords: string) {
  
}
